package com.project.XXXX.identification.tool;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import com.project.XXXX.inter.tbl_jobenrollMapper;
import com.project.XXXX.inter.tbl_ptjobMapper;
import com.project.XXXX.model.tbl_jobenroll;
import com.project.XXXX.model.tbl_ptjob;
import com.project.XXXX.model.tbl_sysuser;

public class ValidateTool {
	public static boolean IsMyJob(tbl_sysuser tbl_sysuser,tbl_ptjobMapper tbl_ptjobMapper,int ptid)
	{
	
       tbl_ptjob t = tbl_ptjobMapper.selectByPrimaryKey(ptid);
		if(t!=null)
		{
			return StringUtils.equals(tbl_sysuser.getMobile(), t.getCreatorid());
		}
       return false;
		
	}
	public static boolean IsJobEnroll(tbl_sysuser tbl_sysuser,tbl_jobenrollMapper tbl_jobenrollMapper ,int ptid)
	{	
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("mobile", tbl_sysuser.getMobile());
		map.put("ptjobid", ptid);
		tbl_jobenroll t = tbl_jobenrollMapper.selectByPtidandmobile(map);
		if(t!=null)
		{
			return true;
		}
       return false;
		
	}

}
